<?php 
session_start();include_once 'data/usercheck.php'; ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<title>Food Online</title>
	<link rel="stylesheet" href="style.css" type="text/css" charset="utf-8" />
</head>
<body>
  <form id="form1" method="post" action="">
    <p>
      <label></label>
    </p>
  </form>
  <div id="wrapper">
    <div id="logo">
	<p>&nbsp;</p>
    <p>&nbsp;</p>
	 <table width="200" border="0" align="center">
    <tr>
      <td height="30"><FONT size="+6">
        <div align="center">STMS</div></td>
    </tr>
    <tr>
      <td><div align="center">STUDENT MANAGEMENT SYSTEM</div></td>
    </tr>
</table>
  <p>&nbsp;</p>
    </div>
    <div id="nav">
      <div id="nav-left">
        <ul>
          <li><a href="HometoAdmin.php">Home</a></li>
          <li class="orange">
            <div align="left"><a href="http://localhost/stms/pages/data/logout.php">Logout-<?php include_once 'data/databaseconnection.php';session_start();echo $_SESSION['username'];?></a></div>
          </li>
        </ul>
      </div>
      <div id="nav-right">
        <ul>
         
           <li><a href="Aboutus.php">About us</a></li>
          <li><a href="viewhome.php">Student</a></li>
          <li><a href="Adminhome.php">Admin</a></li>
          <li><a href="http://studentmanagements.blogspot.com/">Contact</a></li>
        </ul>
      </div>
    </div>
    <style type="text/css">
			div.scrollbar {
				height: 300px;
				overflow: auto;
				border: solid 1px #000;
				padding: 5px;
				width:250px;
			}
		</style>
   <div align="right"></div>
   <div class="clear">
     <div id="body">
       <div align="right">
         <div align="left">
           <div align="left">
             <table width="751" border="0">
               <tr>
                 <td width="96" height="23"><font size="+1"><a href="showadmin.php">Basicdetails</a></font></td>
                 <td width="78"><font size="+1"><a href="aladmin.php">A/Ldetails</a></font></td>
                 <td width="100"><font size="+1"><a href="compinadmin.php">Combination</a></font></td>
                 <td width="64"><font size="+1"><a href="courseadmin.php">Course</a></font></td>
                 <td width="51"><font size="+1"><a href="Resultadmin.php">Result</a></font></td>
                 <td width="90"><font size="+1"><a href="changepass.php"><font size="+1"></font></a><font size="+1"><a href="attendadmin.php">Attendance</a></font></font></td>
                 <td width="242"><div align="right"><font size="+1"><a href="changepass.php">changepassword</a></font></div></td>
               </tr>
             </table>
           </div>
         </div>
       </div>
       <p>&nbsp;</p>
	  <p><?php
        if (isset($_GET['err'])) {
            $err = $_GET['err'];
            echo '<span  style="color:  #F4C389"  >'.$err.'</span>';
			}
	
        if (isset($_GET['err1'])) 
		{
            $err1 = $_GET['err1'];
			
			$sql=mysql_query("select * from gcealdetails where Regno='$err1'");
			while($row=mysql_fetch_array($sql))
			{
				$reg=$row['Regno'];
				$ind=$row['Indexno'];
				$yea=$row['Year'];
				$sch=$row['School'];
				$dist=$row['District'];
				$str=$row['Stream'];
				$res=$row['Result'];
				$zsc=$row['Zscore'];
				$dis=$row['DistrictRank'];
				$isl=$row['IslandRank'];
				
				
			}
        }
        ?>
		</P>
	  <p><font size="-1"><marquee direction="left">The Regno is must for the changes</marquee></font></P>
		<form id="insert" method="post" action="data/insertal.php">
	  <table width="750" border="0">
	    <tr>
	      <td width="477" rowspan="2"><table width="477" border="0">
	        <tr></tr>
	        <tr>
	          <td><font  size="-1">Regno</font></td>
	          <td><input type="text" name="Regno" id="Regno" value="<?php echo $reg; ?>" placeholder="2009/SP/004"  pattern="[0-9]{4}/[A-Z]{2}/[0-9]{3}"/></td>
	          <td><font  size="-1">Result</font></td>
	          <td><input type="text" name="Result" id="Result" value="<?php echo $res; ?>" /></td>
	          </tr>
	        <tr>
	          <td><font  size="-1">Indexno</font></td>
	          <td><input type="text" name="Indexno" id="Indexno" value="<?php echo $ind; ?>" /></td>
	          <td><font  size="-1">Zscore</font></td>
	          <td><input type="text" name="Zscore" id="Zscore" value="<?php echo $zsc; ?>"/></td>
	          <td>&nbsp;</td>
	          </tr>
	        <tr>
	          <td><font  size="-1">Year</font></td>
	          <td><!form id="form2" method="post" action="">
	            <p>
	              <label></label>
	              <select name="Year" value="<?php echo $yea; ?>">
				  <option value='<?php  $name ?>'><?php  $name?></option>
				   <?php
				  $connect = mysql_connect("localhost", "root", "") or die ("Error , check your server connection.");
mysql_select_db("stms");

		 $result=mysql_query("SELECT * FROM new");
		
					while($row=mysql_fetch_array($result))
					{
		echo "<option value='".$row['al']."'>".$row['al']."</option>";
					}
					
					?>
	                </select>
	              <a href="data/year.php?a=al" >next</a></p>
	            <!/form></td>
	          <td><font  size="-1">DistricRank</font></td>
	          <td><input type="text" name="DistrictRank" id="DistricRank" value="<?php echo $dis; ?>" /></td>
	          </tr>
	        <tr>
	          <td><label for="School"><font  size="-1">School</font></label></td>
	          <td><input type="text" name="School" id="School" value="<?php echo $sch; ?>" /></td>
	          <td><font  size="-1">IslandRank</font></td>
	          <td><input type="text" name="IslandRank" id="IslandRank" value="<?php echo $isl; ?>" /></td>
	          <td>&nbsp;</td>
	          </tr>
	        <tr>
	          <td><label for="District"><font  size="-1">District</font></label></td>
	          <td><input type="text" name="District" id="District"  value="<?php echo $dist; ?>"/></td>
	          <td>&nbsp;</td>
	          <td>&nbsp;</td>
	          <td>&nbsp;</td>
	          </tr>
	        <tr>
	          <td height="46"><font  size="-1">Stream</font></td>
	          <td><!form id="form3" method="post" action="">
	            <p>
	              <label>
	                <select name="Stream" value="<?php echo $str; ?>">
	                  <option value="maths">maths</option>
	                  </select>
	                </label>
	              </p>
	            <!/form>
	            <label></label></td>
	          <td>&nbsp;</td>
	          <td>&nbsp;</td>
	          </tr>
          </table></td>
		  
		  
	      <td width="257"><p>
	        <label for="Search">Search</label>
            <input type="text" name="Searcher" id="Search"  />
            <input type="submit" name="Search2" id="Search3" value="Search" />
	      </p></td>
        </tr>
	    <tr>
	      <td><?php
		 
		  if(isset($_GET['err2'])) 
		{
		 $err2 = $_GET['err2'];
		 $result=mysql_query("SELECT * FROM gcealdetails WHERE Regno='$err2'");
		  
		  require_once 'data/databaseconnection.php';
		echo  "<div class=scrollbar >";
			echo "<table border=1>";
			echo "<tr>";
			echo "<th>Regno</th>";
			echo "<th>Indexno</th>";
			echo "<th>Year</th>";
			echo "<th>School</th>";
			echo "<th>District</th>";
			echo "<th>Stream</th>";
			echo "<th>Result</th>";
			echo "<th>Zscore</th>";
			echo "<th>DistrictRank	</th>";
			echo "<th>IslandRank</th>";
			
			
			
			//$result=mysql_query("SELECT * FROM gcealdetails");
			while($row=mysql_fetch_array($result))
			{
				echo "<tr><td>".$row['Regno'];
				echo "<td>".$row['Indexno'];
				echo "<td>".$row['Year'];
				echo "<td>".$row['School'];
				echo "<td>".$row['District'];
				echo "<td>".$row['Stream'];
				echo "<td>".$row['Result'];
				echo "<td>".$row['Zscore'];
				echo "<td>".$row['DistrictRank'];
				echo "<td>".$row['IslandRank'];
				
				
			}
			echo "</table>";
		}
		else
		{
			  require_once 'data/databaseconnection.php';
		echo  "<div class=scrollbar >";
			echo "<table border=1>";
			echo "<tr>";
			echo "<th>Regno</th>";
			echo "<th>Indexno</th>";
			echo "<th>Year</th>";
			echo "<th>School</th>";
			echo "<th>District</th>";
			echo "<th>Stream</th>";
			echo "<th>Result</th>";
			echo "<th>Zscore</th>";
			echo "<th>DistrictRank	</th>";
			echo "<th>IslandRank</th>";
			
			
			
			$result=mysql_query("SELECT * FROM gcealdetails");
			while($row=mysql_fetch_array($result))
			{
				echo "<tr><td>".$row['Regno'];
				echo "<td>".$row['Indexno'];
				echo "<td>".$row['Year'];
				echo "<td>".$row['School'];
				echo "<td>".$row['District'];
				echo "<td>".$row['Stream'];
				echo "<td>".$row['Result'];
				echo "<td>".$row['Zscore'];
				echo "<td>".$row['DistrictRank'];
				echo "<td>".$row['IslandRank'];
				
				
			}
			echo "</table>";
		}
			echo "</div>";
		  ?></td>
        </tr>
       </table>
	  <p>&nbsp;</P>
	  
	    <p>&nbsp;</p>
	    <table width="377" border="0">
	      <tr>
	        <td><div align="center">
	          <input type="submit" name="ADD" id="ADD" value="Add" />
	          </div></td>
	        <td><div align="center">
	          <input type="submit" name="UPDATE" id="UPDATE" value="Update" />
	          </div></td>
	        <td><input type="submit" name="DELETE" id="DELETE" value="Delete" /></td>
	        <td><input type="submit" name="Search" id="Search2" value="Search" /></td>
          </tr>
	      </table>
	    <div align="left"></div>
	   </form>
     </div>
      <div id="footer">
        <ul>
          <li><a href="HometoAdmin.php">Home</a> | </li>
          <li><a href="Aboutus.php">About Us</a> | </li>
          <li></li>
          
          <li><a href="http://studentmanagements.blogspot.com/">Contact</a></li>
        </ul>
        <p>copyright &copy;STMS Group03</p>
      </div>
    </div>
</div>
</body>
</html>
